package com.tuteng.administrator.ashospital.application;

import android.app.Activity;
import android.app.Application;

import com.tuteng.administrator.ashospital.beans.BindCardResponse;
import com.tuteng.administrator.ashospital.beans.LandReqBean;

import java.util.LinkedList;
import java.util.List;

import cn.jpush.android.api.JPushInterface;

public class hospitalAppication  extends Application {
    private static final String TAG = "EasyScreenShotApplication";
private  static hospitalAppication mInstance;
    private List<Activity> mActivityList = new LinkedList<Activity>();
   //该对象存储用户信息
private BindCardResponse response=null;

    public BindCardResponse getResponse() {
        return response;
    }

    public void setResponse(BindCardResponse response) {
        this.response = response;
    }

    /**
     * Default WorkSpace's path
     */
    private String mDefaultWorkeSpacePath = null;
    /**
     * User clip path
     */

    public static synchronized hospitalAppication getInstance() {
        if (mInstance == null) {
            mInstance = new hospitalAppication();
        }
        return mInstance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
//这两行为初始化极光
        JPushInterface.setDebugMode(true); 	// 设置开启日志,发布时请关闭日志
        JPushInterface.init(this);     		// 初始化 JPush
        mInstance = this;
    }

    @Override
    public void onTerminate() {

        super.onTerminate();
    }
    /**
     * Add activity in the RunTime-Manage-activity-list
     */
    public void addActivity(Activity activity) {
        if (activity != null && !mActivityList.contains(activity)) {
            mActivityList.add(activity);
        }
    }

    /**
     * Remove activity from the RunTime-Manage-activity-list
     */
    public void removeActivity(Activity activity) {
        if (activity != null && mActivityList.contains(activity)) {
            mActivityList.remove(activity);
        }
    }

    /**
     * traves the RunTime-Manage-activity-list and finish all of them
     */
    public void exitApp() {
        for (Activity act : mActivityList) {
            if (act != null) act.finish();
        }
        System.exit(0);
    }


}
